<?php defined('SYSPATH') or die('No direct script access.');
 
class Model_Abackground extends ORM {
	protected $_table_name = 'background';

    public function params() {
        return array(
        	'model' => 'Abackground',
            'table' => 'background',
            'fields' => array(
                'title' => array(
                    'title' => 'Описание',
                    'type' => 'text',
                    'name' => 'title',
                ),
                'image' => array(
                    'title' => 'Превью',
                    'type' => 'image',
                    'name' => 'image',
                    'image_params' => array(
                        'width' => 1600,
                        'height' => null,
                        'handling' => 'resize',
                        'resize_type' => Image::WIDTH,
                        'dir' => $_SERVER['DOCUMENT_ROOT'].'/static/uploads/background',
                        'url' => URL::base().'static/uploads/background',
                    ),
                    'thumbnails' => array(
                        'admin' => array(
                            'width' => 300,
                            'height' => 200,
                            'handling' => 'resize_crop',
                            'resize_type' => Image::AUTO,
                        ),
                    ),
                ),
            ),
            'main_title' => 'Фон сайта',
            'waymark' => 'title',
            'sortable' => TRUE
        );
    }

}